import pygame
pygame.init()

class Button(pygame.sprite.Sprite):
  def __init__(self,x,y):
    pygame.sprite.Sprite.__init__(self)  
    self.image = pygame.Surface((200,50))
    self.image.fill((150,255,150))
    self.rect = self.image.get_rect()
    self.rect.x = x
    self.rect.y = y
    buttons.add(self)
  def update(self):
    mouse_pos = pygame.mouse.get_pos()
    if self.rect.collidepoint(mouse_pos):
      self.image.fill((50,255,50))
    else:
      self.image.fill((150,255,150))
class Pipe(pygame.sprite.Sprite):
  def __init__(self,x,y):
    pygame.sprite.Sprite.__init__(self)
    self.image = pygame.Surface((50,50))
    self.rect = self.image.get_rect()
    self.rect.x = x
    self.rect.y = y
      
screen = pygame.display.set_mode((800,600))

fon = pygame.image.load('fon.jpg')
fon = pygame.transform.scale(fon,(800,600))

buttons = pygame.sprite.Group()
start_button = Button(300,300)
shop_button = Button(300, 450)
pipes = pygame.sprite.Group()


scene = "menu"
run = True
while run:
  keys = pygame.key.get_pressed()
  if scene == "menu":
    screen.fill('white')
    buttons.draw(screen)
    buttons.update()
  if scene == "game":
    screen.blit(fon,(0,0))
    
    pygame.display.update()
  
  events = pygame.event.get()
  for event in events :
    if event.type == pygame.QUIT:
      run = False
    if event.type == pygame.MOUSEBUTTONDOWN:
      if scene == "menu":
        if start_button.rect.collidepoint(event.pos):
          scene = "game"
    